package com.jack;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

@SpringBootApplication
@EnableDiscoveryClient
@EnableZuulProxy
@EnableRedisHttpSession
public class ZuulgatewayApplication {

	public static void main(String[] args) {
		SpringApplication.run(ZuulgatewayApplication.class, args);
	}

	/*@Bean
	public CorsFilter corsFilter() {
		final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
		final CorsConfiguration config = new CorsConfiguration();
		config.setAllowCredentials(true);
		config.addAllowedOrigin("*");
		config.addAllowedHeader("*");
		//config.addAllowedMethod("OPTIONS");
		//config.addAllowedMethod("HEAD");
		//config.addAllowedMethod("GET");
		//config.addAllowedMethod("PUT");
		//config.addAllowedMethod("POST");
		//config.addAllowedMethod("DELETE");
		//config.addAllowedMethod("PATCH");
		config.addAllowedMethod("*");
		source.registerCorsConfiguration("*//**", config);
	 return new CorsFilter(source);
	 }*/

}
